<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .style1{
    margin: 20px 0;
    padding: 20px;
    border: 1px purple solid;
  }
</style>
<body>
<h1>get实例</h1>
<div class="style1">
  <button onclick="getUser()">获取用户信息</button>
  <div id="getResult" class="response">GET结果在这里显示</div>
</div>
<h1>post实例</h1>
<div class="style1">
  <input type="text" id="title" placeholder="输入内容"><br>
  <textarea id="content" placeholder="输入内容"></textarea>
  <button onclick="postMessage()">post信息</button>
  <div id="postResult" class="response">POST结果在这里显示</div>
</div>
<script src="./demo1.js"></script>
</body>
</html>